<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template name="cutEmail">
 <xsl:param name="email"/>
 <xsl:choose>
   <xsl:when test="string-length($email) &gt; 20">
     <xsl:value-of select="substring($email,0,20)"/>
   </xsl:when>
   <xsl:otherwise>
     <xsl:value-of select="$email"/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:template>

<xsl:template match="row">

<xsl:variable name="status">
	<xsl:choose>
		<xsl:when test="floor( @uStatus div 32 ) mod 2">
			/imgs/mela.gif
		</xsl:when>
		<xsl:when test='floor( @uStatus div 16 ) mod 2 and (@sexid="24" or @sexid="26")'>
			/imgs/ananas_m.gif
		</xsl:when>
		<xsl:when test='floor( @uStatus div 16 ) mod 2 and (@sexid="25" or @sexid="27")'>
			/imgs/ananas_f.gif
		</xsl:when>
		<xsl:when test='floor( @uStatus div 4 ) mod 2 and (@sexid="24" or @sexid="26")'>
			/imgs/frag_m.gif
		</xsl:when>
		<xsl:when test='floor( @uStatus div 4 ) mod 2 and (@sexid="25" or @sexid="27")'>
			/imgs/frag_f.gif
		</xsl:when>
		<xsl:when test="@certified=1">
			/imgs/certifiedmini.gif
		</xsl:when>
		<xsl:otherwise>
			/imgs/spacer.gif
		</xsl:otherwise>
	</xsl:choose>
</xsl:variable>

<table class="bboxL" border="0" cellspacing="0" cellpadding="2" width="100%">

<tr height="25px"><td class="nboxT"><img style="padding-top:3px;" src="{$status}"/>&#160;<b><a class="black" href="/unsubscribe/emailSettings.aspx"><xsl:value-of select="@Nick"/></a></b></td></tr>

<xsl:choose>
	<xsl:when test="( @authlevel mod 2 )">
		<tr><td><a href="/tests/myPolls.aspx"><b>I tuoi sondaggi</b></a></td></tr>
	</xsl:when>
</xsl:choose>
<xsl:choose>
	<xsl:when test="floor( @authlevel div 2 ) mod 2 or floor( @authlevel div 16 ) mod 2">
<xsl:choose>
	<xsl:when test="@wfor&gt;0">
		<tr><td><a href="/admin/forumsManagement.aspx"><b>Manage Forums</b><br/><font class="b10b">(<xsl:value-of select="@wfor"/> in attesa)</font></a></td></tr>
	</xsl:when>
	<xsl:otherwise>
		<tr><td><a href="/admin/forumsManagement.aspx"><b>Manage Forums</b></a></td></tr>
	</xsl:otherwise>
</xsl:choose>
	</xsl:when>
</xsl:choose>
<xsl:choose>
	<xsl:when test="(floor( @authlevel div 8 ) mod 2)">
		<xsl:choose>
			<xsl:when test="@whol&gt;0">
				<tr><td><a href="/admin/holidaysWaiting4Approval.aspx"><b>Waiting Holidays</b><br/><font class="b10b">(<xsl:value-of select="@whol"/> in attesa)</font></a></td></tr>
			</xsl:when>
			<xsl:otherwise>
				<tr><td><a href="/admin/holidaysWaiting4Approval.aspx"><b>Waiting Holidays</b></a></td></tr>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:when>
</xsl:choose>
<xsl:choose>
	<xsl:when test="(floor( @authlevel div 8 ) mod 2) or (floor( @authlevel div 512 ) mod 2)">
		<xsl:choose>
			<xsl:when test="@wact&gt;0 and @wgal&gt;0">
				<tr><td><a href="/admin/activitiesManagement.aspx"><b>Manage Activities</b><br/><font class="b10b">(<xsl:value-of select="@wact"/> activity in attesa)</font><br/><font class="b10b">(<xsl:value-of select="@wgal"/> gallery in attesa)</font></a></td></tr>
			</xsl:when>
			<xsl:when test="@wact&gt;0">
				<tr><td><a href="/admin/activitiesManagement.aspx"><b>Manage Activities</b><br/><font class="b10b">(<xsl:value-of select="@wact"/> activity in attesa)</font></a></td></tr>
			</xsl:when>
			<xsl:otherwise>
				<tr><td><a href="/admin/activitiesManagement.aspx"><b>Manage Activities</b></a></td></tr>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:when>
</xsl:choose>
<xsl:choose>
	<xsl:when test="(floor( @authlevel div 64 ) mod 2) or (floor( @authlevel div 16384 ) mod 2)">
		<tr><td><a href="/admin/usersManagement.aspx"><b>Manage users</b>
<xsl:choose>
	<xsl:when test="@wnuk&gt;0 and (floor( @authlevel div 4096 ) mod 2)">
		<br/><font class="b10b">(<xsl:value-of select="@wnuk"/> da cancellare)</font>
	</xsl:when>
</xsl:choose>
<xsl:choose>
	<xsl:when test="@wcer&gt;0">
		<br/><font class="b10b">(<xsl:value-of select="@wcer"/> da certificare)</font>
	</xsl:when>
</xsl:choose>
<xsl:choose>
	<xsl:when test="@wpic&gt;0">
		<br/><font class="b10b">(<xsl:value-of select="@wpic"/> pic in attesa)</font>
	</xsl:when>
</xsl:choose>
		</a></td></tr>
	</xsl:when>
</xsl:choose>
<xsl:choose>
	<xsl:when test="floor( @authlevel div 32 ) mod 2">
		<tr><td><a href="/admin/nextBirthdays.aspx"><b>Prossimi compleanni</b></a></td></tr>
	</xsl:when>
</xsl:choose>
<xsl:choose>
	<xsl:when test="floor( @authlevel div 128 ) mod 2">
		<tr><td><a href="/forumShow.aspx?jumpToForum=2560&amp;forumStep=20"><b>Forum staff</b></a></td></tr>
	</xsl:when>
</xsl:choose>
<xsl:choose>
	<xsl:when test="(floor( @uStatus div 32 ) mod 2) or (floor( @uStatus div 16 ) mod 2) or (floor( @uStatus div 4 ) mod 2)">
		<tr><td><a href="/logShow.aspx?logid=1&amp;logStep=20"><b>Log staff</b></a></td></tr>
	</xsl:when>
</xsl:choose>
<xsl:if test="@authlevel &gt;='0'">
	<tr><td align="center"><img src="/imgs/white_sp.gif" width="75%" height="1" vspace="3" hspace="0"/></td></tr>
</xsl:if>

<xsl:choose>
	<xsl:when test="@purity&gt;0">
		<tr><td><a href="/userProfile.aspx">Il tuo profilo</a></td></tr>
	</xsl:when>
	<xsl:otherwise>
		<tr><td><a href="/userProfile.aspx">Il tuo profilo</a><br/><font class="b10b">(purity test non eseguito)</font></td></tr>
	</xsl:otherwise>
</xsl:choose>
<xsl:choose>
	<xsl:when test="@unread&gt;0">
		<tr><td><a href="/mailbox/mailbox.aspx">La tua posta<br/><font class="b10b">(<xsl:value-of select="@unread"/> da leggere)</font></a></td></tr>
	</xsl:when>
	<xsl:otherwise>
		<tr><td><a href="/mailbox/mailbox.aspx">La tua posta</a></td></tr>
	</xsl:otherwise>
</xsl:choose>
<tr><td><a href="/buddies.aspx">Amichetti ed amichette</a></td></tr>
<tr><td><a href="/baddies.aspx">I rompiscatole</a></td></tr>
<tr><td align="center"><hr size="1" width="75%"/></td></tr>
<tr><td><a href="/myForums.aspx">I tuoi forum</a></td></tr>
<tr><td><a href="/activities/activities.aspx">i tuoi eventi</a></td></tr>
<xsl:choose>
	<xsl:when test="floor( @authlevel div 8 ) mod 2">
		<tr><td><a href="/holidays/myHolidays.aspx">Le tue vacanze</a></td></tr>
	</xsl:when>
	<xsl:otherwise>
		<tr><td><a href="/holidays/myHolidays.aspx">Le tue vacanze</a></td></tr>
	</xsl:otherwise>
</xsl:choose>
<tr><td align="center"><hr size="1" width="75%"/></td></tr>
<tr><td align="center"><a href="/logout.aspx"><b>Logout!</b></a></td></tr>
</table>
</xsl:template>

</xsl:stylesheet>